<?php
namespace Realisation\Web\Controller;

use Symfony\Component\HttpFoundation\Request;
use Realisation\DataProvider\ApiDataProvider;
use Silex\Application;

/**
 * Description of MessageController
 *
 * @author pahhan
 */
class SiteController extends AbstractApiController
{
    public function get(Request $request, Application $app)
    {
        $provider = new ApiDataProvider($app['db']);
        $stmt = $provider->getSites();

        $builder = $this->createBuilder($request);

        $content = $builder->buildSites($stmt);
        $response = $this->createResponse($request);
        $response->setContent($content);
        return $response;
    }
}

